#include "../s21_decimal.h"

int s21_is_invalid(s21_decimal *value) {
  if (value == NULL) {
    return TRUE;
  }

  int scale = s21_get_scale(value);

  return scale < 0 || scale > 28 ? TRUE : FALSE;
}

int s21_is_valid(s21_decimal *value) {
  return s21_is_invalid(value) == TRUE ? FALSE : TRUE;
}

void s21_copy(s21_decimal *source, s21_decimal *distination) {
  for (int i = 0; i <= LAST; i++) {
    distination->bits[i] = source->bits[i];
  }
}